from libc.stdlib cimport malloc, free 

ctypedef double real

cdef class Girl:
    cdef public:
        str name
        long age 
        str gender
    cdef real *scores

    def __cint__(self, *args, **kwargs):
        self.scores = <real *> malloc( 3 * sizeof(real) )
    
    def __init__(self, name, age, gender):
        self.name = name 
        self.age = age 
        self.gender = gender
    def __dealloc__(self):
        if self.scores != NULL:
            free(self.scores)
    cpdef set_scores(self, list scores):
        assert scores is not None and len(scores)==3
        cdef real score 
        cdef Py_ssize_t idex

        print("set values")
        print("aa")
        print("bb")
        for idx, score in enumerate(scores):
            self.scores[idx] = score
    cpdef list get_score(self):
        cdef list res = [
        self.scores[0], self.scores[1],self.scores[2]
          ]
        return res
    # def set_scores(self,int i, real x):
        # print("set value")
        # (self.scores[i] ) = x
    # def print_scores(self, i):
        # print((self.scores[i] ))

